//参数说明:video - mp4地址
myApp.showVideoPanel = function(video){

    var popupHTML = '<div class="popup video-popup">'+
        '<div >'+
        '<p><a href="#" class="close-popup">X</a></p>'+
        '<video id="video-play_html5_api" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto">' +
        '<source src="' + video + '" type="video/mp4">' +
        '<p class="vjs-no-js">请升级您的浏览器以支持播放视频~</p>' +
        '</video>' +
        '</div>'+
        '</div>';

    myApp.popup(popupHTML);

    var player;

    $$('.video-popup').on('opened', function () {
        setTimeout(function(){
            //player = videojs('video-play_html5_api', {}, function() {
            //
            //    this.play(); //播放
            //
            //    setTimeout(function(){
            //        this.play();
            //    },100)
            //
            //    //this.on('ended', function() {
            //    //    console.log('awww...over so soon?');
            //    //});
            //
            //    this.on('error',function(){
            //        setTimeout(function(){
            //            myApp.closeModal();
            //        }, 800);
            //    });
            //});

            player = videojs('video-play_html5_api').ready(function(){
                var myPlayer = this;
                myPlayer.play();

                this.on('error',function(){
                    setTimeout(function(){
                        myApp.closeModal();
                    }, 800);
                });
            });
        }, 100);

    });

    $$('.video-popup').on('closed', function () {
        player.dispose();
    });
}
